(function (window){
	function Loading (gameWidth, gameHeight) {
		this.gameHeight = gameHeight;
		this.gameWidth = gameWidth; 
	}

	Loading.prototype = new createjs.Container();
	Loading.prototype.Container_initialize = Loading.prototype.initialize();
	// hàm khởi tạo
	Loading.prototype.initialize = function(){
		//Initial all of resources for this class
		this.mainImg 		= this.load(contentmanager.bg_main, this.gameWidth/2, this.gameHeight/2);
		this.bannerImg 		= this.load(contentmanager.banner, this.gameWidth/2, this.gameHeight/2);
				//non-important text
		//this.textCurrentLevel = this.CreateText("0", 535, 16);
		createjs.Tween.get(this.bannerImg,{loop:true}).to({scaleX:1.1, scaleY: 1.1}, 600).to({scaleX:0.9, scaleY: 0.9}, 800);

		this.textCurrentLevel = new Text("0",'bold 30px Arial', '#000');
		this.textCurrentLevel.x = 527;
		this.textCurrentLevel.y = 16;
		this.textCurrentLevel.alpha = 0.8
		this.addChild(this.textCurrentLevel);

		this.bg_ruby		= this.load(contentmanager.bg_ruby, 695, 35, 0.9, 0.9);


		this.textCurrentRuby = new Text("0",'bold 30px Arial', '#000');
		this.textCurrentRuby.x = 665;
		this.textCurrentRuby.y = 16;
		this.textCurrentRuby.textAlign = 'center';
		this.textCurrentRuby.alpha = 0.8
		this.addChild(this.textCurrentRuby);

	}	

	//Cài đặt việc update lại số level và số kim cương
	Loading.prototype.updateData = function() {
		this.textCurrentLevel.text = savescore.getUserLevel();
		this.textCurrentRuby.text = savescore.getRuby();
	};

	Loading.prototype.load = function (data, x, y, scaleX, scaleY) {
		var bitmap = new createjs.Bitmap(data);
		var width = bitmap.image.width;
		var height = bitmap.image.height;
		bitmap.x = x || 0;
		bitmap.y = y || 0;
		bitmap.regX = width/2;
		bitmap.regY = height/2;
		bitmap.scaleX = scaleX || 1;
		bitmap.scaleY = scaleY || 1;
		bitmap.width = width*bitmap.scaleX;
		bitmap.height = height*bitmap.scaleY;
		this.addChild(bitmap);
		return bitmap;
	}





	window.Loading = Loading;
}(window));